using System;
using EPiServer.Common;
using EPiServer.Common.Queries;
using EPiServer.Common.Security;
using EPiServer.Community.Poll;
using EPiServer.Community.Poll.Queries;

namespace EPiAbstractions.Community.Poll
{
    public interface IPollHandlerFacade
    {
        EPiServer.Community.Poll.Poll AddPoll(EPiServer.Community.Poll.Poll poll);

        void UpdatePoll(EPiServer.Community.Poll.Poll poll);

        void RemovePoll(EPiServer.Community.Poll.Poll poll);

        EPiServer.Community.Poll.Poll GetPoll(Int32 id);

        PollCollection GetPolls(Int32 page, Int32 pageSize, PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, out Int32 totalItems, PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, NullValueAction siteNullAction, PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, NullValueAction siteNullAction, out Int32 totalItems, PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, SiteCollection sites, PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, SiteCollection sites, out Int32 totalItems, PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, DateTime activeDate, PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, DateTime activeDate, out Int32 totalItems, PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, SiteCollection sites, DateTime activeDate, PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, SiteCollection sites, DateTime activeDate, out Int32 totalItems,
                                PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, SiteCollection sites, NullValueAction siteNullAction, PollStatus pollStatus,
                                PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, SiteCollection sites, NullValueAction siteNullAction, PollStatus pollStatus,
                                out Int32 totalItems, PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, SiteCollection sites, DateTime activeDate, PollStatus pollStatus,
                                PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, SiteCollection sites, DateTime activeDate, PollStatus pollStatus,
                                out Int32 totalItems, PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, PollStatus pollStatus, PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, PollStatus pollStatus, out Int32 totalItems, PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, DateTime activeDate, PollStatus pollStatus, PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, DateTime activeDate, PollStatus pollStatus, out Int32 totalItems,
                                PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, SiteCollection sites, NullValueAction siteNullAction, DateTime activeDate,
                                PollStatus pollStatus, PollSortOrder[] sortOrder);

        PollCollection GetPolls(Int32 page, Int32 pageSize, SiteCollection sites, NullValueAction siteNullAction, DateTime activeDate,
                                PollStatus pollStatus, out Int32 totalItems, PollSortOrder[] sortOrder);

        ChoiceCollection GetChoices(EPiServer.Community.Poll.Poll poll);

        Choice GetChoice(Int32 choiceId);

        VoteCollection GetVotes(ChoiceCollection choices, Int32 page, Int32 pageSize, VoteSortOrder[] order);

        VoteCollection GetVotes(ChoiceCollection choices, Int32 page, Int32 pageSize, out Int32 totalItems, VoteSortOrder[] order);

        void Vote(Vote vote);

        Boolean HasVoted(IUser user, EPiServer.Community.Poll.Poll poll);

        event EPiServerCommonEventHandler PollAdded;

        event EPiServerCommonEventHandler PollUpdated;

        event EPiServerCommonEventHandler PollRemoved;

        PollCollection GetQueryResult(PollQuery query);

        PollCollection GetQueryResult(PollQuery query, Int32 page, Int32 pageSize);

        PollCollection GetQueryResult(PollQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        ChoiceCollection GetQueryResult(ChoiceQuery query);

        ChoiceCollection GetQueryResult(ChoiceQuery query, Int32 page, Int32 pageSize);

        ChoiceCollection GetQueryResult(ChoiceQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        VoteCollection GetQueryResult(VoteQuery query);

        VoteCollection GetQueryResult(VoteQuery query, Int32 page, Int32 pageSize);

        VoteCollection GetQueryResult(VoteQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);
    }
}